<template>
  <div class="wrap">
    <div class="card-table">
      <TableComponent
      :columns="stockInforColumns"
      :data="tableData"
      :total="total"
      :table-option="tableOption"
      :page-option="pageOption.page"
      @change="pageChange"
      :stripe="stripe" />
    </div>
  </div>
</template>

<script>
import TableComponent from '@/components/Table/table'
import { stockInforColumns } from '../js/index.js'
import { companySharePrices } from '@/api/modules/propertyRight.js'
export default {
  components: {
    TableComponent
  },
  data() {
    return {
      publicForm: {
        cmhkId: ''
      },
      stockInforColumns,
      tableData: [],
      tableOption: {
        isShowOperate: false
      },
      pageOption: {
        cmhkId: '',
        page: {
          pageSize: 10,
          pageNum: 1
        }
      },
      total: 0,
      stripe: true
    }
  },
  methods: {
    querySharePrices(params) {
      this.pageOption.cmhkId = params.cmhkId
      companySharePrices(this.pageOption).then(res => {
        if (res.data.code === '0') {
          this.tableData = res.data.body.list
          this.total = res.data.body.total
        }
      })
    },
    pageChange(val) {
      console.log(val);
      this.pageOption.page = val
      this.querySharePrices(this.pageOption)
    }
  }
}
</script>

<style lang="less" scoped>
  .wrap {
    .card-table {
      width: 100%;
    }
  }
</style>
